import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  //  路由
  {
    path: "/",
    component: () => import("@/views/layout"),
    children: [
      {
        path: "",
        name: "Home",
        component: () => import("@/views/home"),
        meta: {
          title: "首页",
        },
      },
      {
        path: "fenlei",
        name: "Fenlei",
        component: () => import("@/views/fenlei"),
        meta: {
          title: "分类",
        },
      },
      {
        path: "fabu",
        name: "Fabu",
        component: () => import("@/views/fabu"),
        meta: {
          title: "发布文章",
        },
      },
      {
        path: "my",
        name: "My",
        component: () => import("@/views/my"),
        meta: {
          title: "我的",
        },
      },
    ],
  },
  {
    path: "/login",
    name: "Login",
    component: () => import("@/views/login"),
  },
  {
    path: "/zhuce",
    name: "Zhuce",
    component: () => import("@/views/zhuce"),
  },
  {
    path: "/liebiao",
    name: "LieBiao",
    component: () => import("@/views/liebiao"),
  },
  {
    path: "/xiangqing",
    name: "Xiangqing",
    component: () => import("@/views/xiangqing"),
  },
  {
    path: "/myCang",
    name: "MyCang",
    component: () => import("@/views/myCang"),
  },
  {
    path: "/myText",
    name: "MyText",
    component: () => import("@/views/myText"),
  },
  {
    path: "/myZan",
    name: "MyZan",
    component: () => import("@/views/myZan"),
  },
  {
    path: "/myZiliao",
    name: "MyZiLiao",
    component: () => import("@/views/myZiliao"),
  },
];

const router = new VueRouter({
  routes,
});

export default router;
